home *** CD-ROM | disk | FTP | other *** search
- Unit GEDDEFS;
-
- interface
-
- Uses Dos,StrTool,Serinout;
-
- {$IFOPT N+}
- Type Real =Double;
- {$ENDIF}
-
- Const DelFac : Integer=10;
- No_Blink : Word = 0;
- BildRecSize = 37; (* Bild- Record Groesse *)
- {$IFOPT N+}
- Co8087 = ' / [80x87]';
- {$ELSE}
- Co8087 = '';
- {$ENDIF}
- Version='5.51';
- VersionCode =$510;
- copyright :Str64 = '(c) by Wolfgang Maier 1993';
- MaxLayer =31;
-
- var DirMask,Filename,
- ActivePath,
- Macropath :PathStr;
- DataF :PathStr;
- Outstring : Str80;
-
-
- type {$IFDEF Schneider16}
- ScrDriver = (CGA,HERC,EGA,OLI,PC1512,ACAD,MCGA);
- {$ELSE}
- ScrDriver = (CGA,HERC,EGA,OLI,PC15No,ACAD,MCGA);
- {$ENDIF}
-
- DrTyp = (Keiner,Epson120,Epson240,NEC180,Nec360,
- HP150,HP300,PT90,BJ180,BJ360,HP180,HP600);
- GrLineType = (full,dashed,dotted,full1,dashed1,dotted1,
- hi1, hi2, hi3, hi4, hi5, hi6);
- (* Zusatz fuer Marktarget (Hilite) *)
- GrChType = Byte;
- { Bit 0 : Normal=0 Kursiv=1}
- { Bit 1 : Spiegelschrit =1 }
- { Bit 2 : Proportional =1 }
- { Bit 3 : Schmalschrift =1 }
- { Bit 4 : 0 =Zeichensatz 1/ 1 =Zeichensatz 2}
-
- Koord =Record
- X,Y :Integer;
- End;
- Layer = 0..31;
- Layerset = Set of Layer;
- Element =(Auge,Quadrat,Kreis,Linie,Rechteck,Schrift,
- Macro,Masspfeil,Achteck,Oval,Kurve,M_line,M_arc,
- M_peek,M_text,M_points,View,
- ED_CON1,ED_CON2,ED_CON3,ED_Men,ED_time,ED_Info);
- EDInfoTyp=(Container,FontInfo,LibInfo,Lib2,Lib3,DimRef);
-
- Defaults = Record
- Status : Integer; {+0}
- ZoomAll,
- GEDVersion:Integer; {+2} { $402 = BVersion 4.02 }
- Ursprung : Koord; {+6}
- Einheit :System.Real;{+10}
- Masstab : Integer; {+16}
- Ebenen_alt: set of 0..7; {+18}
- Raster_alt: Byte; {+19}
- Rin : Byte; {+20}
- Rout : Byte; {+21}
- Rebene : Layer; {+22}
- Qin : Byte; {+23}
- Qout : Byte; {+24}
- Qebene : Layer; {+25}
- Width : Byte; {+26}
- ChHeight : Byte; {+27}
- ChType : GrChType; {+28}
- Massebene :Layer; {+29}
- Hidden_alt : Set of 0..7; {+30}
- MassHoehe :Byte; {+31}
- AugenTyp :Element; {+32}
- KommaStellen:Byte; {+33}
- Mtextebene:Layer; {+34}
- Reserved :Array[1..2] of Byte; {+35}
- End;
-
-
- Type FestPunkt =Record
- Case Byte of
- 0 :(N :Word; I :Longint);
- 1: (N1 :LongInt;I1 :Integer);
- 2: (W0,W1,W2 :Integer);
- end;
-
-
- (* 8086/88 Deklaration *)
- Const Augen =0;
- Linien =1;
- Kreise =2;
- Rechtecke=3;
- Texte =4;
- Macros =5;
- Bemassung=6;
- Kurven =7;
-
- Type
- ElementSet =Set of Element;
-
- Elem_Groups = Array[Augen..Kurven] of ElementSet;
-
- Const ElementGruppen :Elem_Groups =
- ([Auge,Quadrat,Oval,AchtEck],[Linie],[Kreis],
- [Rechteck],[Schrift],[Macro],
- [Masspfeil,M_Line,M_arc,M_text,M_peek,M_points],
- [Kurve]);
-
- Type
- DateRec = Record
- Year,
- Day,
- Month,
- Hour,
- Minutes :Word;
- end;
-
- PinTyp =(EAKanal,Eingang,Ausgang,Notused);
-
- (* Bild- Record definition *)
-
- Bildelement = Record {rel. Offset }
- Status : Word; {+ 0 }
- Aufhaenger : Koord; {+ 2 }
- Ebene : Layer; {+ 6 }
- Orient : Integer; {+ 7 }
- LTyp : GrLineType; {+ 9 }
- Case ElementTyp : Element Of {+ 10}
- Auge,
- Achteck,
- Oval : ( AussenD , {+ 11}
- InnenD : Integer; {+ 13}
- APinNr :Word; {+ 15}
- APinTyp :PinTyp; {+ 17}
- {$IFDEF GEODAT}
- A_Zvalue :String[14]; {+18}
- {$ELSE}
- APinName :Str5; {+ 18}
- ASymbname :str8; {+ 24..32}
- {$ENDIF}
- Oval_Len :Integer); {+ 33 }
- Quadrat : ( QInnenD , {+ 11}
- QBreite : Integer;{+ 13}
- QPinNr : Word; {+ 15}
- QPinTyp :PinTyp; {+ 17}
- QPinName :Str5; {+ 18}
- QSymbname :Str8); {+ 24..32}
- Kreis,
- M_arc : ( Segmentalpha, {+ 11}
- Segmentbeta, {+ 13}
- HalbX ,HalbY :Integer; {+ 15,17}
- SectorFill :Boolean; {+ 19}
- Kbreite :Integer);{+ 20..21}
-
- Linie,
- M_line : ( Endpunkt : Koord; {+ 11}
- LBreite : Integer; {+ 15}
- {$IFDEF GEODAT}
- L_Zvalue : String[14]; {+18}
- L_ZDummy : Byte;
- {$ELSE}
- Signalname : Str15; {+ 17}
-
- {$ENDIF}
- Signalnummer : Word); {+ 33..34}
- { ist bei M_line Nr der Bemassungsuntergruppe}
- Rechteck: ( Rand : Integer; {+ 11}
- Rfill : Boolean; {+ 13}
- RLaenge , {+ 14}
- Rbreite : Integer ); {+ 16}
- Schrift: ( Hoehe : System.Real; {+ 11}
- Art : GrChType; {+ 17}
- Wortlaut : Str15); {+ 18..33}
-
- Macro : ( Faktor : System.Real; {+ 11}
- Masterfile : Str8; {+ 17}
- PartNr : Word; {+ 26}
- PartX,PartY : ShortInt; {+ 28}
- {Ltyp enthält in bit 0..3 Lowbits(X) und
- in bit 4..7 Lowbits(Y) }
- TextOrient : Byte; {+ 30}
- PartID : Str3); {+ 31,32,33,34}
- M_text : ( M_Hoehe : System.Real; {+ 11}
- M_Art : GrChType; {+ 17}
- M_Wortlaut : String[14]); {+ 18..32}
- M_peek : ( MP_Hoehe : System.Real);{+ 11}
- M_points,
- Kurve :( Defpoints : Array[1..5] {+ 11}
- of Koord;
- Npoints : Byte; {+31}
- Bemasstyp : Byte; {+32}
- Kur_Breite : Word); {+33}
-
- Masspfeil :( Masslaenge : Integer; {+ 11}
- MSize : System.Real; {+ 13}
- Masstext : Str15; {+ 19}
- GruppenNr : Word); {+ 35}
-
- View :(View_Ebs :Layerset; {+11}
- View_Hid :Layerset; {+15}
- View_zoom :Integer;{+19}
- View_Orig :Koord; {+21}
- View_Name :Str10); {+25}
- { bei View enthält Ltyp folgende Bits:
- Bit0 = Füllen
- Bit1 = Linienenden runden }
- ED_Men :(Menuename :Str15);
- ED_Time :(WorkingTime :Longint; {+11}
- { Arbeitszeit in sekunden}
- Created :DateRec;
- Updated :DateRec);
- { Orient: ist Versions-Zähler }
- End;
-
- (* Datentypen ED_CONF1..3 sind Kompatibel zu Bildelement !!!*)
-
- ED_CONF1 = Record
- Status : Word; {+ 0 }
- Aufhaenger1: Koord; {+ 2 }
- Ebene1 : Layer; {+ 6 }
- Orient1 : Integer; {+ 7 }
- LTyp1 : GrLineType; {+ 9 }
- ElementTyp1: Element; {+10 = ED_CON1}
- Gitter : System.Real; {+11}
- SnapWeite :System.Real; {+17}
- OrthoSnap :Integer; {+23}
- Osnap :System.Real; {+25}
- AutoTrace :Boolean; {+31}
- Extsearch :Boolean; {+32}
- Adapt :Boolean; {+33}
- Filling :Boolean; {+34}
- MACextsearch:Boolean; {+35}
- Autoosnap :Boolean; {+36}
- End;
- ED_CONF2 = Record
- Status : Word; {+ 0 }
- Relbezug : Koord; {+ 2 }
- Bezugsmarke: Boolean; {+ 6 } {0 oder 1 ist <100}
- Orient2 : Integer; {+ 7 }
- LTyp2 : GrLineType; {+ 9 }
- ElementTyp2: Element; {+10 = ED_CON2}
- Ebenen :Layerset; {+11}
- Hidden :Layerset; {+15}
- Suchebenen :Layerset; {+19}
- Suchelemente:ElementSet; {+23}
- MacroFac :System.Real; {+26 Default für COPY-MAC}
- Polygon, {+32}
- Relativ, {+33 , Aufhänger=Bezugspunkt}
- RastRelat :Boolean; {+34}
- ActualLayer:Byte; {+35}
- ActualLTyp:GrLineType; {+36}
- End;
-
- ED_CONF3 = Record
- Status : Word; {+ 0 }
- Aufhaenger3: Koord; {+ 2 }
- BitFlag3 : Byte; {+ 6 }
- DimOrient : Integer; {+ 7 }
- LTyp3 : GrLineType; {+ 9 }
- ElementTyp3: Element; {+10 = ED_CON2}
- R8in : Byte; {+11, Achteckige Augen}
- R8out : Byte; {+12}
- R8ebene : Layer; {+13}
- OVin : Byte; {+14, Ovale Augen}
- OVout : Byte; {+15}
- OVlen : Byte; {+16}
- OVebene : Layer; {+17}
- mm_RE, {+18 Angabe mm/RE}
- Drag : Boolean; {+19}
- HatchPhi : Integer; {+20}
- Hatchdist : Integer; {+22}
- Hatchlay : Layer; {+24}
- HatchWidth : Byte; {+25}
- Hatchtyp : GrlineType; {+26}
- MassTyp : GrChType; {+27}
- GummiB : Boolean; {+28}
- SwitchLay : Boolean; {+29}
- Layer_oben, {+30}
- Layer_unten: Layer; {+31}
- Fasen_Tiefe :Integer; {+32}
- Runden_Tiefe:Integer; {+34}
- Zusatzflags :Byte; {+36}
- End;
- (*
- Zusatzflags :
- Bit0 Bit7
- ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐
- │ Auto- │ Koord- │ Pfeil -│-Mode │Hide- │ NC-Be- │NC-Ein- │PD-Bit │
- │ Pan │ Display│00=Pfeil│01=Line │Center │ maßung │zel-Bem.│New DWG │
- │ │ │10=Auge │11=Nix │(Kreise)│ │ │ │
- └────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┘
- Bitflag 3
- Bit0 Bit7
- ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐
- │ 45° │Koord- │ Zeige │ │ │ │ │ │
- │ Cursor │Display │ PinInfo│ │ │ │ │ │
- │ │ │ │ │ │ │ │ │
- └────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┘
-
- *)
- ED_INFOTyp= Record
- Status : Word; {+ 0 }
- EDVERSION : WORD; {+ 2 }
- INDEX1 : WORD; {+ 4 }
- INDEX2 : WORD; {+ 6 }
- FLAGS : WORD; {+ 8 }
- ElementTyp : Element; {+10 = ED_INFO}
- Case Typ : EDInfoTyp of {+11 }
- Container :(LibName :Str15; {+12 }
- LIBID :Byte; {+13 }
- Fill:
- array[1..8] of Byte);{+29 }
- FontInfo :(FontName:Str15;
- { für zukünftige GEDDY-Versionen : }
- Size :Word; { Size<>0 : Font in BLD-Datei, Size =0 Font in CHR-Datei }
- StartRec:Word; { StartRec: Offset zu Bld-Datei-Anfang, falls FONT in BLD-Datei }
- NRecs :Word);{ Anzahl BL-Recs des Fonts }
- DimRef :(RefPointName:Str10; { für Bemassung }
- RefGridRel:Boolean;
- RefOrient :Integer;
- Refpoint :Koord)
- End;
-
- Const AutoPan =1;
- Coord_Display =2;
- PD_DWG_Bit =128;
- PfeilModeMask =$0C;
- PfeilModeShift =2;
- Hide_Center =16; { bestimmt, ob bei Kreis und Ellipse Mittelpunkt markiert wird }
- NC_Bemassen =32; { bestimmt, ob NC-Bemassung aktiviert }
- NC_EinzelDim =64; { bestimmt, ob NC-Bemassung einzelne Maßpfeile verwendet }
- Diag_CrossHair =1 ;{ bestimmt, ob Diagonal-Cursor aktiv }
- Show_PinInfo =4 ;
- Type
- Knoten =Record
- Ort :Koord; { derzeitiger Ort des Knotens }
- RecNr :Integer; { RecNr in Datei des Obj./Macro}
- PinName :Str5; { PinName }
- PinNr :Word; { PinNr }
- PartID :Str3; { Teilbez. }
- PartNr :Word; { TeilNr }
- Durchmess :Word; { Augendurchmess}
- Augentyp :Element; { Augentyp (rund,Quadr)}
- end;
-
-
- Connection =Record
- Status :Integer;
- Quelle, Ziel :Knoten;
- Done :Boolean;
- NetzNr :Word;
- Signalname :Str15;
- End;
-
- PaletMode=(NoPal,EGApal,VGApal);
-
-
- Plotdefs =Record
- Pspeed,
- FormX,
- FormY :Integer;
- pendict :Array[0..7] of Integer;
- PenWidth,
- Scaling :System.Real;
- End;
- Pinstall =Record
- HpGl :Boolean;
- Plottername :Str15;
- sepsym :Char;
- TermStr :Str5;
- ResetCom,
- ExitCom :Str64;
- MoveCom,DrawCom,
- SelPenCom,LTFullCom,
- LTDotCom,LTdashCom,
- LSCom,SpeedCom :Str10;
- PenMin,PenMax,
- Speedmin,Speedmax,
- LineScaleMin,LinescaleMax :Integer;
- LineScaleFac,SpeedFac,
- Resolution :System.Real;
- PlotterNr :1..3;
- Serial :Boolean;
- Parity :Paritytype;
- Databits,
- Stopbits :Byte;
- Xonoff :Byte; {0 =Xon/xoff,1=DSR,2=CTS}
- Baudrate :Byte;
- SerPortNr :Byte;
- HandshakeDSR,
- HandshakeCTS :Boolean;
- end;
-
- Moninst =Record
- MonitTyp : ScrDriver;
- HiEGAmode : Integer; { EGA/VGA-Treiber }
- { DOT-OFFSET bei ADI-Treibern }
- Monitname : Str8;
- HatEGApalette: PaletMode;
- end;
-
- EGA_Xinfo =Record
- Is8x8 :Boolean;
- Vmode :Word; { Video-Mode, Register AX,
- INTVEC bei ADI-Treibern }
- Xres,
- Yres :Word;
- ScrSav :Word; { K-Byte Speicherbedarf für Textmode }
- IsVideo7 :Byte;
- { Davon :Bit0 :Video7
- Bits 4..7 Page_set_mode !
- 0 = none
- 1= TSENG4000
- 2 =Video7-Vram
- }
- end;
-
- Dinstall=Record
- DrYSize,
- DrXAspect :System.Real;
- DruckerName :Str15;
- Drucker :DrTyp;
- Dformat :Integer; { 3= A3, 4 =A4 }
- DruckerNr : 1..3;
- Dinit,Dexit :Str15;
- Dgrafik,
- Dteilzeile,
- Drestzeile,
- DLinespacing,
- DColor,
- Dunidir,
- DFWDlinefeed,
- DREVlineFeed :Str10;
- end;
-
- LASinst=Record
- DrYSize,
- DrXAspect :System.Real;
- Drucker :DrTyp;
- Farbfaehig :Boolean;
- Bubblejet :Boolean;
- DruckerNr :1..3;
- InitString :Str64;
- ExitString :Str64;
- Packing :Boolean;
- end;
-
- Bohrdefs =Record
- Sieb_u_Meyer :Boolean;
- Bohrtool :Str8;
- Bohr_LimAuto :Boolean;
- Bohr_LimLay :Layer;
- BohrLays :Layerset;
- BohrSys :1..4;
- BohrfeldW :Integer;
- BohrNdez :Integer;
- BohrXfirst :Boolean;
- Bohrlinks :Boolean;
- Bohrfest :Boolean;
- BohrXCom,
- BohrYCom,
- BohrEnd,
- BohrStart :Str10;
- BohrX0,BohrY0,
- BohrFX1,BohrFX2,
- BohrFY1,BohrFY2,
- BohrScaling :System.Real;
- End;
- Mausdef=Record
- Maustyp :Byte;
- Mausport :Byte;
- Parity :Paritytype;
- Databits :Byte;
- Stopbits :Byte;
- Baudrate :Byte;
- Xscale,Yscale:Byte;
- MausRatio :Byte;
- Absolut :Boolean;
- Tablettinit :Str10;
- end;
-
- FileInf =record
- DWG :Str15;
- DWGPath,
- LIBPath :Str64;
- end;
-
- SetUp =Record
- Voreinstellung : Defaults;
- SetupPlotter : Plotdefs;
- MakeBackup : Boolean;
- EgaPalette : Array[0..15] of Byte;
- PinstInfo : Pinstall;
- MonitInfo : Moninst;
- DinstInfo : Dinstall;
- LASInfo : Lasinst;
- BohrInfo : Bohrdefs;
- MausINFO : Mausdef;
- LastTMPDrive : Str5;
- _Reserve : Array[1..57] of Byte;
- Input_NoClear : Boolean;
- ScanMACS : Boolean;
- Sernumber : Str10;
- Zeichensatz1 : Str15;
- Zeichensatz2 : Str15;
- Zeichensatz3 : Str15;
- Zeichensatz4 : Str15;
- MaxNrOfObjs_T : Longint;
- Entzerrung : System.Real;
- Zoomupdown : System.Real;
- AutoPanDelay : Byte; { Time in 0.1 sec }
- EGA_zusatz : EGA_Xinfo;
- Edsetup1 : ED_Conf1;
- Edsetup2 : ED_Conf2;
- Edsetup3 : ED_Conf3;
- LayerLookup : Array[0..MaxLayer] of Byte;
- MenueFileName : Str15;
- AutoSaveTime : Word; { Zeitintervall für autom. Sichern}
- End;
-
- Eich_Inf =Record
- Xt1,Yt1,
- Xd1,Yd1,
- M0 :System.Real;
- End;
-
- PickRec =Record
- DWGname,
- MACPfad :Pathstr;
- LastTime:Longint;
- end;
- Const
- SetupF ='GED.INF';
- DSuf ='.BLD';
- LibSuf ='.LIB';
- EichF ='EICH.INF';
- DSufBAK ='.BAK';
- FSetupF ='GED.FIL';
- PickFile ='GED.PCK';
- MaxFilestoEdit = 9;
- EdMaxXY =15000;
-
-
- var SetupInfo :Setup;
- FileSetup :FileInf;
-
- Function GetLayer(E:Word):Char;
-
- Function GetEbene(L:Char):Word;
-
- Function LayerNr(E:Word):Word;
-
- Function EbenenIndex(Nr:Word):Word; { 0..31 -> 1..32}
-
- Function EbenenStr(Ebenen:Layerset):Str40;
-
- Procedure EbenenSet(S:Str40; Var L:Layerset);
-
- Function RealtoInt(X:Real):Integer;
-
- Function MUL_AB_DIV_C(A,B,C :Integer):Integer;
- (* berechnet LongInt(A)*LongInt(B) div C *)
- inline($59/ { POP CX CX:=C }
- $5B/ { POP BX BX:=B}
- $58/ { POP AX AX:=A}
- $F7/$EB/ { IMUL BX AX/DX:=AX*BX }
- $F7/$F9); { IDIV CX AX:=AX/DX div CX }
-
- Procedure FestP(X:Real; Var Y :Festpunkt);
-
- Function Scale_FP(X:Integer;M :Festpunkt):Integer;
-
- Procedure Mul_FP(Var X:Festpunkt;Y:Festpunkt);
-
- Function Minimal(X:Integer):Integer;
-
- Procedure Limit(Var I:Integer;Min,Max:Integer);
-
- Procedure FitVersionCode(Var V :Word);
-
- Procedure Update_Obj(Var Obj :Bildelement;VersionCode:Word);
-
- (**********************************************************************)
-
-
- implementation
-
-
- Function GetLayer(E:Word):Char;
- Begin
- If E<8 then
- begin
- If E=0 Then GetLayer:='8' else Getlayer:=Chr(Ord('0')+E);
- end
- else GetLayer:=Chr(Ord('A')+E-8);
- End;
-
- Function GetEbene(L:Char):Word;
- Begin
- If (Ord(L)>Ord('0')) and (Ord(L)<=Ord('7')) then
- GetEbene:=Ord(L)-Ord('0')
- else
- If (Ord(L)>=Ord('A')) and (Ord(L)<=Ord('X')) then
- GetEbene:=Ord(L)-Ord('A')+8
- else GetEbene:=0;
- End;
-
- Function LayerNr(E:Word):Word; {1..32 --> 0..31}
- begin
- If (E=0) or (E>32) then LayerNr:=1
- else
- begin
- If E>8 then LayerNr:=E-1
- else
- If E=8 then LayerNr:=0
- else LayerNr:=E;
- end;
- end;
-
- Function EbenenIndex(Nr:Word):Word; { 0..31 -> 1..32}
- begin
- If (Nr=0) then EbenenIndex:=8
- else
- begin
- If Nr>7 then EbenenIndex:=Nr+1
- else EbenenIndex:=Nr;
- end;
- end;
-
-
- Function EbenenStr(Ebenen:Layerset):Str40;
- Var I,J:Word;
- Rest:Layerset;
- S:Str40;
- begin
- S:='';
- J:=0;
- For I:=0 to MaxLayer do
- If I in Ebenen then Inc(J);
- If Ebenen=[0..MaxLayer] then S:='ALLE'
- else
- begin
- If J>21 then
- Ebenen:=[0..MaxLayer]-Ebenen;
- For I:=1 to Succ(Maxlayer) do
- If LayerNr(I) in Ebenen then S:=S+Getlayer(LayerNr(I));
- If J>21 then S:='ALLE-'+S;
- end;
- EbenenStr:=S;
- end;
-
- Procedure EbenenSet(S:Str40;Var L:Layerset);
- Var I:Word;
- begin
- L:=[];
- For I:=1 to Length(S) do
- L:=L+[GetEbene(S[I])];
- end;
-
- Function RealtoInt;
- {$IFOPT N+}
- Type R87= Record
- W0,W1,W2,W3 :Word;
- end;
- Var Xw :R87 absolute X;
- Exponent :Word;
- begin
- Exponent:=(Xw.W3) and $7ff0;
- If Exponent<$40D0 then RealtoInt:=Round(X)
- else
- If Exponent=$40D0 Then begin
- If Abs(X)< 32767.0 then RealtoInt:=Round(X)
- else
- If (Xw.W3 and $8000)<>0 then RealtoInt:=-MaxInt else RealtoInt:=Maxint;
- end
- else
- If (Xw.W3 and $8000)<>0 then RealtoInt:=-MaxInt else RealtoInt:=Maxint;
- end;
- {$ELSE}
- Type R86= Record
- B0,B1,B2,B3,B4,B5 :Byte;
- end;
- Var Xb :R86 absolute X;
- begin
- With Xb Do
- If B0<$8F then RealtoInt:=Round(X)
- else
- If (B0=$8F) Then
- begin
- If Abs(X)< 32767.0 then RealtoInt:=Round(X)
- else
- If (B5 and $80)<>0 then RealtoInt:=-MaxInt else RealtoInt:=Maxint;
- end
- else
- If (B5 and $80)<>0 then RealtoInt:=-MaxInt else RealtoInt:=Maxint;
- end;
- {$ENDIF}
-
- Procedure FestP;
- {$IFOPT N+}
- Type R87= Record
- W0,W1,W2,W3 :Word;
- end;
- Var Xw :R87 absolute X;
- Exponent :Word;
- begin
- With Xw Do
- begin
- W3:=W3 and $7fff;
- If (W3 and $7ff0)<$40D0 then
- begin
- Y.N1:=trunc(Frac(X)*65536);
- Y.I:=Trunc(X);
- end
- else begin Y.N:=0;Y.I:=16384; end;
- end;
- end;
- {$ELSE}
- Type R86= Record
- B0,B1,B2,B3,B4,B5 :Byte;
- end;
- Var Xb :R86 absolute X;
- begin
- With Xb Do
- begin
- B5:=B5 and $7F ; { Sign auf Null setzen }
- If B0<$8F then
- begin
- Y.N1:=trunc(Frac(X)*65536);
- Y.I:=Trunc(X);
- end
- else begin Y.N:=0;Y.I:=16384; end;
- end;
- end;
- {$ENDIF}
-
- Function Scale_FP(X:Integer;M :Festpunkt):Integer;
- Var R : Festpunkt;
- begin
- Inline($8B/$46/<X/ {MOV AX,X}
- $8B/$5E/<M/ {MOV BX,M.N}
- $09/$C0/ {OR AX,AX set Sign Bit}
- $7c/$04/ {JL neg}
- $F7/$E3/ {MUL BX}
- $EB/$10/ {jmp exit}
- {neg} $F7/$D8/ {NEG AX}
- $F7/$E3/ {MUL BX}
- $31/$C9/ { XOR CX,CX }
- $31/$DB/ { XOR BX,BX }
- $29/$C3/ { SUB BX,AX }
- $19/$D1/ { SBB CX,DX }
- $89/$CA/ { MOV DX,CX }
- $89/$D8/ { MOV AX,BX }
- $89/$C3/ {MOV BX,AX}
- $89/$D0/ {MOV AX,DX}
- $99/ {CWD}
- $81/$C3/$00/$80/ {Add BX,$8000}
- $15/$00/$00/ {ADC AX,0 }
- $83/$D2/$00/ {ADC DX,0}
- $89/$46/<R+2/ {MOV R+2, AX }
- $89/$56/<R+4/ {MOV R+4, DX (R.N1:=M.N*X)}
- $8B/$5E/<M+4/ {MOV BX,M+4}
- $8B/$4E/<M+2/ {MOV CX,M+2}
- $8B/$46/<X/ {MOV AX,X}
- $99/ {CWD DX=Sign(I) }
- $8B/$F0/ {MOV SI,AX}
- $8B/$FA/ {MOV DI,DX}
- $F7/$E1/ {MUL CX}
- $50/ {Push AX}
- $52/ {Push DX}
- $8B/$C6/ {MOV AX,SI}
- $F7/$E3/ {MUL BX}
- $8B/$D8/ {MOV BX,AX}
- $8B/$C7/ {MOV AX,DI}
- $F7/$E1/ {MUL CX}
- $8b/$C8/ {MOV CX,AX}
- $5A/ {POP DX}
- $58/ {POP AX}
- $03/$D3/ {ADD DX,BX}
- $03/$D1/ {ADD DX,CX}
- $03/$46/<R+2/ {ADD AX, R.I+0 }
- $13/$56/<R+4/ {ADC DX,R.I+2 }
- $83/$FA/$00/ {CMP DX,0 }
- $7F/$07/ {JG L1 }
- $7C/$0A/ {JL L2 }
- $3D/$FF/$7F/ {CMP AX,7fff }
- $76/$05/ {JNB L2 }
- {L1:} $B8/$FF/$7F/ {MOV AX,32767}
- $EB/$0F/ {JMP EXIT }
- {L2:} $83/$FA/$FF/ {CMP DX,-1 }
- $7C/$07/ {JL L3 }
- $7F/$08/ {JG Exit }
- $3D/$00/$80/ {CMP AX,8000 }
- $73/$03/ {JNB EXIT }
- $B8/$00/$80/ {MOV AX,8000 }
- $89/$46/$FE); {MOV [BP-2],AX }
- {EXIT: ......}
- end;
-
- Procedure Mul_FP(Var X:Festpunkt;Y:Festpunkt);
- Var I,I2,I3,I4:LongInt;
- N :Word;
- begin
- I4:=LongInt(X.N)*LongInt(Y.N);
- I:=X.I*Y.I;
- I2:=X.N*Y.I;
- I3:=X.I*Y.N;
- Inline($8B/$46/<I4+2/ { MOV AX, I4+2 }
- $31/$DB/ { XOR BX,BX }
- $31/$C9/ { XOR CX,CX }
- $03/$46/<I2/ { ADD AX, I2 }
- $13/$5E/<I2+2/ { ADC BX, I2+2 }
- $83/$D1/$00/ { ADC CX, 0 }
- $03/$46/<I3/ { ADD AX, I3 }
- $13/$5E/<I3+2/ { ADC BX, I3+2 }
- $83/$D1/$00/ { ADC CX, 0 }
- $03/$5E/<I/ { ADD BX,I }
- $13/$4E/<I+2/ { ADC CX,I+2 }
- $89/$46/<N/ { MOV N, AX }
- $83/$F9/$00/ {CMP CX,0 }
- $75/$06/ {JNZ L1 }
- $81/$FB/$FF/$7F/ {CMP BX,7fff }
- $7E/$05/ {JLE EXIT }
- {L1:} $BB/$FF/$7F/ {MOV BX,32767}
- $31/$C9/ {XOR CX,CX }
- {EXIT} $89/$5E/<I/ { MOV I, BX }
- $89/$4E/<I+2); { MOV I+2,CX }
- X.I:=I;
- X.N:=N;
- end;
-
-
- Function Minimal(X:Integer):Integer;
- Begin
- If X<1 Then Minimal:=1 Else Minimal:=X;
- End;
-
- Procedure Limit(Var I:Integer;Min,Max:Integer);
- begin
- IF I>Max then I:=Max;
- If I<Min Then I:=Min;
- end;
-
- Procedure FitVersionCode(Var V :Word);
- begin
- V:=V and $7FF;
- If V>VersionCode+$10 then V:=0;
- { Datei neuer als Zeichnungseditor }
- end;
-
- Procedure Update_Obj(Var Obj :Bildelement;VersionCode:Word);
- {muss auch beim einkopieren von Macros durchgeführt werden}
- begin
- With Obj Do
- begin
- If VersionCode<$404 then GruppenNr:=0;
- Case ElementTyp of
- Auge,
- Quadrat : If VersionCode<$510 then
- Begin
- APinTyp:=EAKanal;
- APinNr :=0;
- {$IFDEF GEODAT}
- A_Zvalue:='';
- {$ELSE}
- ApinName:='';
- ASymbName:='';
- {$ENDIF}
- end;
- Macro : If VersionCode<403 then
- begin
- PartID:='';
- PartX:=0;PartY:=0;
- PartNr:=0;TextOrient:=0;
- end;
- end; {Case}
- end;
- end;
-
-
- end.
-